package ${content.items.serviceImpl.packageName};
<#assign assign_ClassName = content.items.serviceImpl.className>
<#assign assign_EntityName = content.items.entity.className>
<#assign assign_daoName = content.items.dao.camelName>
<#assign tableName = content.content.tableName>
<#assign camelName = content.content.camelName>
import lombok.extern.slf4j.Slf4j;
import ibp.ioc.service.core.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import ${content.items.service.packageName}.${content.items.service.className};
import ${content.items.dao.packageName}.${content.items.dao.className};
import ${content.items.entity.packageName}.${content.items.entity.className};

/**
 * ${content.items.service.className}接口的默认实现
 * 
 * @author ist
 *
 */
@Slf4j
@Service("${content.items.service.className?uncap_first}I")
public class ${assign_ClassName}  extends BaseServiceImpl implements ${content.items.service.className} {

	@Autowired
	private ${content.items.dao.className} ${tableName}DAO;


	//码值转换
	private void transcodeFor${tableName?cap_first}(${assign_EntityName} ${camelName}) {}

	//获取列表数据
	public List<${assign_EntityName}> get${tableName?cap_first}List(${assign_EntityName} ${tableName}){
		List<${assign_EntityName}>  list= ${tableName}DAO.get${tableName?cap_first}List(${tableName});
		for(${assign_EntityName} dto:list){//码值转换
			transcodeFor${tableName?cap_first}(dto);
		}
		return  list;
	};


	//获取详情数据
	public ${assign_EntityName} get${tableName?cap_first}Disp(${assign_EntityName} ${tableName}){
		${assign_EntityName} ${camelName}= ${tableName}DAO.get${tableName?cap_first}Disp(${tableName});
		transcodeFor${tableName?cap_first}(${camelName});//码值转换
		return  ${camelName};
	};


	//保存数据
	@Transactional
	public void insert${tableName?cap_first}(${assign_EntityName} ${tableName}) {
		${tableName}DAO.insert${tableName?cap_first}(${tableName});
	}


<#if content.content.primaryField??>
	<#assign assign_idFieldType = content.content.primaryField[0].fieldType>
	<#assign assign_idFieldName = content.content.primaryField[0].fieldName>
	//更新数据
	@Transactional
	public void update${tableName?cap_first}(${assign_EntityName} ${tableName}) {
		${tableName}DAO.update${tableName?cap_first}(${tableName});
	}


	//删除数据
	@Transactional
	public void delete${tableName?cap_first}(${assign_EntityName} ${tableName}) {
		${tableName}DAO.delete${tableName?cap_first}ById(${tableName}.get${content.content.primaryField[0].fieldNamePascal}());
	}
</#if>

}
